package com.yi.servicedriveruser.controller;

import com.yi.internalcommon.dto.ResponseResult;
import com.yi.servicedriveruser.mapper.DriverUserMapper;
import com.yi.servicedriveruser.service.DriverUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private DriverUserService driverUserService;
    @GetMapping("/test")
    public String test(){
        return "service-driver-user";
    }
    @GetMapping("/test-db")
    public ResponseResult testDb(){

        return driverUserService.testDriverUser();
    }

    //测试mapper中的xml是否正常使用
    @Autowired
    private DriverUserMapper driverUserMapper;
    @GetMapping("/test-xml")
    public int testXml(String cityCode) {
        int i = driverUserMapper.selectDriverUserCountByCityCode(cityCode);
        return i;
    }
}
